<template>
	<view class="main">
		<!-- <view class="title">
			<view @click="jionTopic" class="jiontopic">
				<van-icon  name="search" size="20px" style="margin-right: 6rpx; font-size: 16px;vertical-align:middle" />
				加话题
				<van-icon />
			</view>
			<view @click="jionTopic" class="jiontopic quiz">
				<van-icon  name="add" style="margin-right: 6rpx; font-size: 16px;" />
				提问
				<van-icon />
			</view>
		</view> -->
		<view class="answerlist" v-for="i in lists" :key="i">
			<view class="biaoti">
				<text class="border"></text>
				<text class="interest">你可能感兴趣的</text>
			</view>
			<view class="" style="font-size: 30rpx;font-weight: 700;">#&nbsp;{{i.title}}</view>
			<view class="content" @click="handledToDetail(i.threadId)">{{i.content.text}}</view>
			
			<view class="fooder">
				<!-- <view class="browse">9656浏览·402关注</view> -->
				<!-- <view class="answer" @click="quiz">
					<van-icon  name="edit " style="margin-right: 6rpx; font-size: 16px;" />
					写回答
					<van-icon /> 
				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	import {getTopicList} from '@/api/circle.js'
	export default {
		data() {
			return {
				lists: []
			}
		},
		onLoad() {
			this.getTopicList()
		},
		methods: {
			quiz(){
				uni.navigateTo({
					url:'/page_forum/quiz/quiz'
				})
			},
			getTopicList() {
				let data =
					`page=${1}&perPage=${200}&filter[categoryids][0]=${2}&filter[categoryids][1]=${3}&filter[categoryids][2]=${4}&filter[categoryids][3]=${5}filter[essence]0=${0}&filter[attention]=${0}&filter[sort]=${1}&scope=${0}&dzqSid=${74874316-1664446553074}&dzqPf=${'h5'}&`;
				getTopicList(data).then(res => {
					console.log(res)
					this.lists = res.data.Data.pageData
				})
			},
			handledToDetail(i){
				console.log(i)
				uni.navigateTo({
					url: '/page_forum/articledetail/articledetail?id=' +i
				})
			},
		}
	}
</script>

<style lang="scss">
	.main {
		height: 100vh;
		background-color: #f6f6f6;
		padding: 15rpx;
		.title {
			display: flex;
			justify-content: space-between;
			align-items: center;
			height: 82rpx;
			padding: 0 15rpx;
			border: 1px solid #289958;
			border-radius: 20rpx;
			color: #289958;
			.jiontopic {
				font-size: 28rpx;
			}
			.quiz {
				background-color: #289958;
				color: #fff;
				width: 140rpx;
				height: 54rpx;
				line-height: 54rpx;
				text-align: center;
				border-radius: 50px;
				font-size: 24rpx;
			}
		}
	}
	.answerlist {
		background-color: #fff;
		border-radius: 16rpx;
		height: 232rpx;
		margin-top: 15rpx;
		padding: 15rpx 20rpx;
		box-sizing: border-box;
		font-size: 24rpx;
		.biaoti {
			display: flex;
			.border {
				display: inline-block;
				width: 30rpx;
				height: 30rpx;
				border-radius: 50%;
				background-color: #d9d9d9;
				line-height: 30rpx;
				margin-right: 10rpx;
			}
			.interest{
				display: inline-block;
				height: 30rpx;
				line-height: 30rpx;
			}
		}
		.content {
			// font-weight: 700;
			font-size: 28rpx;
			margin-top: 10rpx;
			// height: 110rpx;
		}
		.fooder {
			display: flex;
			align-items: center;
			justify-content: space-between;
			.browse {
				font-size: 22rpx;
				color: #999;
			}
			.answer {
				background-color: #289958;
				color: #fff;
				width: 140rpx;
				height: 54rpx;
				text-align: center;
				line-height: 54rpx;
				border-radius: 50px;
			}
		}
		
	}
	
</style>
